package com.xuecheng.auth.service.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.xuecheng.auth.model.po.XcUser;
import com.xuecheng.auth.service.mapper.XcUserMapper;
import com.xuecheng.auth.service.service.XcUserService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author Mia
 */
@Slf4j
@Service
public class XcUserServiceImpl extends ServiceImpl<XcUserMapper, XcUser> implements XcUserService {

    @Autowired
    XcUserMapper xcUserMapper;
    @Override
    public XcUser selectById(String id) {
        return xcUserMapper.selectById(id);
    }

    @Override
    public XcUser selectByUserName(String username) {
        return xcUserMapper.selectOne(new LambdaQueryWrapper<XcUser>().eq(XcUser::getUsername,username));
    }
}
